
import requests
from lxml import etree

"""
需求：爬取58二手房中的房源信息
"""
# 获取页面源码数据
url = 'https://jn.58.com/ershoufang/'
headers = {
    'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36'
}
page_text = requests.get(url=url,headers=headers).text

# 实例化一个etree对象
tree = etree.HTML(page_text)
tree.xpath =




















